<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$lAddedImo = RealEstate::model()->findAll(array("order" => "id DESC",
    "limit" => '2',
   'condition'=> 'activ=1 and date_expire >"'.date('Y-m-d').'"',
    ));
$lAddedBus = Business::model()->findAll(array("order" => "id DESC",
    "limit" => '2',
    'condition'=> 'activ=1 and date_expire >"'.date('Y-m-d').'"',
    ));
$lAddedSer = Service::model()->findAll(array("order" => "id DESC",
    "limit" => '2',
    'condition'=> 'activ=1 and date_expire >"'.date('Y-m-d').'"',
    ));
$lAddedHmade = Homemade::model()->findAll(array("order" => "id DESC",
    "limit" => "2",
    'condition'=> 'activ=1 and date_expire >"'.date('Y-m-d').'"',
    ));

foreach ($lAddedBus as $key => $value) {
   echo "<br><br><a href='". $this->createUrl('/business/view',array('id'=>$value->id))."'><img class='imgresult img-polaroid' src='/uploads$value->img1". "'/></a> ".Yii::t("content","$value->title",array(),"db_i18n");
}
foreach ($lAddedImo as $key => $value) {
    echo "<br><br><a href='". $this->createUrl('/realEstate/view',array('id'=>$value->id))."'><img class='imgresult img-polaroid' src='/uploads$value->img1". "'/></a> ".Yii::t("content","$value->title",array(),"db_i18n");
}

foreach ($lAddedSer as $key => $value) {
   echo "<br><br><a href='". $this->createUrl('/service/view',array('id'=>$value->id))."'><img class='imgresult img-polaroid' src='/uploads$value->img1". "'/></a> ".Yii::t("content","$value->title",array(),"db_i18n");
}
foreach ($lAddedHmade as $key => $value) {
    echo "<br><br><a href='". $this->createUrl('/homemade/view',array('id'=>$value->id))."'><img class='imgresult img-polaroid' src='/uploads$value->img1". "'/></a>".Yii::t("content","$value->title",array(),"db_i18n");
}
?>
